
from south.db import db
from django.db import models
from ideavolution.ideas.models import *

class Migration:
    
    def forwards(self, orm):
        
        # Adding model 'Content'
        db.create_table('ideas_content', (
            ('text', models.TextField(null=True, blank=True)),
            ('link', models.FileField(null=True, blank=True)),
            ('id', models.AutoField(primary_key=True)),
            ('title', models.CharField(max_length=100, null=True, blank=True)),
        ))
        db.send_create_signal('ideas', ['Content'])
        
        # Adding model 'Idea'
        db.create_table('ideas_idea', (
            ('content', models.ForeignKey(orm.Content, null=True, blank=True)),
            ('id', models.AutoField(primary_key=True)),
            ('parent', models.ForeignKey(orm.Idea, related_name='child_set', null=True, blank=True)),
        ))
        db.send_create_signal('ideas', ['Idea'])
        
        # Adding ManyToManyField 'Idea.connection_set'
        db.create_table('ideas_idea_connection_set', (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('from_idea', models.ForeignKey(Idea, null=False)),
            ('to_idea', models.ForeignKey(Idea, null=False))
        ))
        
    
    
    def backwards(self, orm):
        
        # Deleting model 'Content'
        db.delete_table('ideas_content')
        
        # Deleting model 'Idea'
        db.delete_table('ideas_idea')
        
        # Dropping ManyToManyField 'Idea.connection_set'
        db.delete_table('ideas_idea_connection_set')
        
    
    
    models = {
        'ideas.content': {
            'id': ('models.AutoField', [], {'primary_key': 'True'}),
            'link': ('models.FileField', [], {'null': 'True', 'blank': 'True'}),
            'text': ('models.TextField', [], {'null': 'True', 'blank': 'True'}),
            'title': ('models.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'})
        },
        'ideas.idea': {
            'Meta': {'ordering': "['id']"},
            'connection_set': ('models.ManyToManyField', ["'self'"], {'null': 'True', 'blank': 'True'}),
            'content': ('models.ForeignKey', ['Content'], {'null': 'True', 'blank': 'True'}),
            'id': ('models.AutoField', [], {'primary_key': 'True'}),
            'parent': ('models.ForeignKey', ["'self'"], {'related_name': "'child_set'", 'null': 'True', 'blank': 'True'})
        }
    }
    
    complete_apps = ['ideas']
